package work.parabola.keyboardswitch.pojo.query.manufacturer;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.commons.lang3.StringUtils;
import work.parabola.keyboardswitch.common.ServerResponse;

@Data
@ToString
@EqualsAndHashCode
public class ListQuery {
    private String searchWord;

    public ServerResponse validate() {
        if (StringUtils.isBlank(this.searchWord)) {
            this.searchWord = null;
        } else {
            this.searchWord = "%" + this.searchWord + "%";
        }
        return ServerResponse.createBySuccess();
    }

}
